// 路由配置

//常量路由
export const constantRoutes = [
  {
    path: "/",
    name: "layout",
    component: () => import("@/components/layout/Index.vue"),
    redirect: "/home",
    meta: {
      title: "",
      hidden: false,
      icon: "",
    },
    children: [
      {
        path: "/home",
        name: "Home",
        component: () => import("@/views/home/Index.vue"),
        meta: {
          title: "首页",
          hidden: false,
          icon: "Avatar",
        },
      },
    ],
  },
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login/Index.vue"),
    meta: {
      title: "登录",
      hidden: true,
      icon: "UploadFilled",
    },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/404/Index.vue"),
    meta: {
      title: "404",
      hidden: true,
      icon: "UploadFilled",
    },
  }
];

//异步路由(动态路由)
export const asyncRoutes = [
  {
    path: "/permission",
    name: "Permission",
    component: () => import("@/components/layout/Index.vue"),
    meta: {
      title: "权限管理",
      hidden: false,
      icon: "Lock",
    },
    redirect: "/permission/user",
    children: [
      {
        path: "/permission/user",
        name: "User",
        component: () => import("@/views/permission/user/Index.vue"),
        meta: {
          title: "用户管理",
          hidden: false,
          icon: "UserFilled",
        },
      },
      {
        path: "/permission/role",
        name: "Role",
        component: () => import("@/views/permission/role/Index.vue"),
        meta: {
          title: "角色管理",
          hidden: false,
          icon: "User",
        },
      },
      {
        path: "/permission/menu",
        name: "Menu",
        component: () => import("@/views/permission/menu/Index.vue"),
        meta: {
          title: "菜单管理",
          hidden: false,
          icon: "Histogram",
        },
      },{
        path: "/permission/dictionary",
        name: "Dictionary",
        component: () => import("@/views/permission/dictionary/Index.vue"),
        meta: {
          title: "数据字典",
          hidden: false,
          icon: "Tickets",
        },
      },
    ],
  },
  {
    path: "/other",
    name: "Other",
    component: () => import("@/components/layout/Index.vue"),
    meta: {
      title: "其他",
      hidden: false,
      icon: "Setting",
    },
    redirect: "/other/page1",
    children: [
      {
        path: "/other/page1",
        name: "Page1",
        component: () => import("@/views/other/page1/Index.vue"),
        meta: {
          title: "页面1",
          hidden: false,
          icon: "Promotion",
        },
      },
      {
        path: "/other/page2",
        name: "Page2",
        component: () => import("@/views/other/page2/Index.vue"),
        meta: {
          title: "页面2",
          hidden: false,
          icon: "Promotion",
        },
      },
      {
        path: "/other/page3",
        name: "Page3",
        component: () => import("@/views/other/page3/Index.vue"),
        meta: {
          title: "页面3",
          hidden: false,
          icon: "Promotion",
        },
      },
    ],
  },
  {
    path: "/goodPool",
    name: "GoodPool",
    component: () => import("@/components/layout/Index.vue"),
    meta: {
      title: "宜家配送",
      hidden: false,
      icon: "Van",
    },
    redirect: "/goodPool/list",
    children: [
      {
        path: "/goodPool/list",
        name: "List",
        component: () => import("@/views/goodPool/Index.vue"),
        meta: {
          title: "个人订单",
          hidden: false,
          icon: "User",
        },
      },
      {
        path: "/other/topic",
        name: "topic",
        component: () => import("@/views/other/topic/Index.vue"),
        meta: {
          title: "所有订单",
          hidden: false,
          icon: "UserFilled",
        },
      },
      {
        path: "/topic/details",
        name: "details",
        hidden: false,
        component: () => import("@/views/other/topic/details.vue"),
        meta: {
          title: "订单详情",
          hidden: true,
          icon: "Document",
        },
      },
      {
        path: "/topic/dispatching",
        name: "Dispatching",
        component: () => import("@/views/other/topic/Dispatching.vue"),
        meta: {
          title: "新建派工",
          hidden: false,
          icon: "Paperclip",
        },
      },
      {
        path: "/topic/map",
        name: "Map",
        component: () => import("@/views/other/topic/map.vue"),
        meta: {
          title: "地图派工",
          hidden: false,
          icon: "Paperclip",
        },
      },
      {
        path: "/topic/dispatchingSelect",
        name: "DispatchingSelect",
        component: () => import("@/views/other/topic/DispatchingSelect.vue"),
        meta: {
          title: "派工查询",
          hidden: false,
          icon: "Promotion",
        },
      },
      {
        path: "/goodPool/cancelOrder",
        name: "CancelOrder",
        component: () => import("@/views/goodPool/CancelOrder.vue"),
        meta: {
          title: "消单订单",
          hidden: false,
          icon: "EditPen",
        },
      },
      
      {
        path: "/topic/planning",
        name: "Planning",
        component: () => import("@/views/other/topic/Planning.vue"),
        meta: {
          title: "划工设置",
          hidden: false,
          icon: "Coin",
        },
      },
      {
        path: "/car/index",
        name: "Car",
        component: () => import("@/views/car/Index.vue"),
        meta: {
          title: "人车信息",
          hidden: false,
          icon: "Coin",
        },
      },
      {
        path: "/car/push",
        name: "Push",
        component: () => import("@/views/car/push.vue"),
        meta: {
          title: "推送信息",
          hidden: false,
          icon: "Coin",
        },
      },
    ],
  }
];

//任意路由
export const anyRoute = {
  path: "/:pathMatch(.*)*",
  redirect: "/404",
  name: "any",
  meta: {
    title: "任意路由",
    hidden: true,
    icon: "",
  },
};